<?php

declare (strict_types=1);

namespace App\Model;

use Hyperf\Database\Model\Relations\HasOne;

/**
 * @property int $id
 * @property string $username
 * @property string $nickname
 * @property string $password
 * @property string $mobile
 * @property string $email
 * @property int $create_time
 * @property int $create_ip
 * @property int $update_time
 * @property int $status
 * @property string $openid
 */
class AdminUser extends Model {
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'admin_user';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected array $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected array $casts = ['id' => 'integer', 'create_time' => 'integer', 'create_ip' => 'integer', 'update_time' => 'integer', 'status' => 'integer'];

    public function userData(): HasOne {
        return $this->hasOne(AdminUserData::class, 'uid', 'id');
    }
}
